home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1996 #5
/
Amiga Plus CD - 1996 - No. 5.iso
/
pd
/
tools
/
menublaster
/
menublaster.doc
< prev
next >
Wrap
Text File
|
1994-01-01
|
11KB
|
264 lines
MENUBLASTER 'documents'
Note: MB stands in this text for MenuBlaster, MM for MenuMaster.
MB is FREELY DISTRIBUTABLE, as long as it's intact and docs follow the
program.
WHOTHEH*LL & WHYTHEH*LL?
This program is written 100% Assembler by me, 'The Only and LAME.... Archy!'
to replace MenuMaster © C. Papademetrious, because MM:s window didn't
look good in 2.0. Well, whatta are you excpecting for using PrintIText/eqv.
onto window title bar....
Besides, I got some new ideas for a program like these ones. Quit and Update
should've been internal in MM. Now user has to insert them into
configfile. Relative free memory and free disk space displays are
useful when debugging programs. Set relative mem on, start your own program,
quit it, and you see memory/disk losses right away.
This (kind of) program(s) have one BIG advantage compared to e.g. Workbench:
Start e.g. sys:tools/commodities/exchange with WB. Then, start it from
MB menu (not existing now, this is just an example). Which way is
easier and faster. MB scores, I think.
Yea, yea, there's the World's Greatest ToolManager around. Couple of
things into WB:s Tools menu and.... No good. At least I have over 80
things in MB menus. Try to push 80 things into only one menu..... they need
the whole strip.
How about docks? They're too big, some window is always over them....
No good. Besides, 80 things won't fit into docks anyway. Or maybe they fit,
but they would use half of WB screen....
I'm... satisfied to MB. I don't know what you're using, and
I'm not pressuring (I hope). Things you just read, were only cold facts.
USAGE
You're reading these docs, so, you've started the program. It probably
yelled 'Can't open config file!'. That's because you don't have the config
file in S: yet. Create config and choose 'Update' from internal menu.
NB: From now on, in this text 'internal menu' means that '?' menu
in the left edge of the menubar of MB window. 'User menus' are
those other, configurable menus.
So, usage is
MenuBlaster [configfile]
If no configfile name is given, config will be read from S:MB.config.
Then, I think, we have to dicuss about that mentioned config file.
Start a text editor and edit a file just like this (or just grab
this piece here):
DISK DH0:
;if line starts with semicolon, it will be ignored
HOTKEY RSHIFT!RALT
DRAG
MENU "Project"
ITEM "NewCLI" | c:newcli |n
ITEM "Preferences"
SUBI "Palette" | sys:prefs/palette
SUBI "Pointer" | sys:prefs/pointer
MENU "Music"
ITEM "MultiPlayer" | sys:music/multiplayer |m
ITEM "Audition 4 demo" | sys:music/audition4_demo |a
MENU "Games"
ITEM "MiniPac" | sys:games/MiniPac |p
ITEM "Tank You" | sys:games/TankYou
ENDE
Done? Save it as S:MB.config. Then get a CLI and start MB, or
activate MB window and select 'Update' from internal menu.
Wow! If no requesters popped out, there should be menus in MB menubar,
first of them named 'Project' and contain item 'NewCLI'. If not, something
went wrong. In the requester is reason of the error. Error messages
_should_ be 'understandable'.
Supposed that everything is OK, select that 'NewCLI' from 'Project' menu.
NewCLI popped out? If not, there's no NewCLI command in your C: or
you typed something wrong.
Those odd-looking characters in EOL are hotkey buttons! Try holding
right shift and right alt and pressing 'n'.... NewCLI should pop out,
just like selected from menu. The others are just for example, they won't work,
because you have things in different directories than me.
Just another hotkey: Press hotkey qualifiers and HELP to activate MB window.
Hotkey qualifiers may be one ore more of these:
LSHIFT
RSHIFT
CAPS/CAPSLOCK
CONTROL/CTRL
LALT
RALT
LCOMMAND/LCMD/LAMIGA/LAMG
RCOMMAND/RCMD/RAMIGA/RAMG
Well, those should be enough. They may be typed either lower or upper case, or
mixed. Between qualifiers may be used '!' '|' ',' or ' ', or... mixed!
It's your choice.
SPECIAL HOTKEY THINGS!
Try this:
HOTKEY ralt!rshift!FRONT!INACTIVATE
Looks cool, eh? Explanations:
FRONT activating MB window by hotkey HELP causes WB to pop in front. If you're
using HUGE screens and PopUpMenu/eqv. leave this off and use MB from anywhere
you want without tumbeling with MB window. (That makes almost no sense, but
it's 3 AM and I'm debugging this f*cking MB instead of sleeping)
INACTIVATE after activating MB window by hotkey HELP and selecting something
from MB menu causes the screen, which was active before, to be in front,
and the window active before to be activated again.
(If you know what that means, please write and explain it to me)
As hotkey buttons may be used a-z (NOTE: LOWER.. eh... lower case),
0-9 (not numeric pad), ,./;'][\=-`.
F1-F10 not available (yet. Yes, this is f*cking lame thing, but to keep this
program under 100 kB :) I passed them).
If no hotkey qualifier is given (no HOTKEY line in config),
hotkeys are not active. If hotkey qualifier is given, HELP always activates
MB window.
DRAG in config means, that MB window will be draggable. Yea, I should have
included position-presetting in that thing, but I'm in hurry, tired and
lazy. A note in finnish:
-Arsi! Tässä sinulle Draggaabeli ikkuna!
DRAG will effect only when starting MB, not when updating. Laziness problem
again...
Some things about configfile format:
There has to be at least one space/tab between command and parameters.
After 'ENDE' everything in the config is ignored, 'ENDE' MUST exist.
(Yes, I'm a Finn, not German. That 'ENDE' is 'ENDE' instead of 'END' just
because my routine handles only commands with at least 4 chars. Had to add
that 'E' to make it work.....)
Every command (ITEM, DISK etc) may be typed either lower or upper case,
or mixed. Rest of the text is used as text in menus and to launch a program,
they're not critical.
I just tested MB a little. It should swallow anything without crashing.
Now, typing this text, I've been using MB for about two weeks without
problems.... or... well, there's been problems, but they've been caused by
other programs. E.g. Protracker causes a Guru loop if started... that guru is
explained later.
That was a brief example of a simple MB.config. Mine is about
4kB long, but I can launch almost any program in my HD from MB menu....
except CLI commands :^).
;--------
Next: Internal menu contents:
About: Well, it's... about. If you wanna know my address...
Update: Re-reads config file, parses menus from it... the works.
Speedy, compared to MM.
Mem relative: Snap this on using RAmiga-M. If selected from menu, readings
won't be zeroes. Reason: When menus are drawn on screen, they
need memory. When that memory is released, readings will
change.
Disk relative: The same, but viewing disk free space. Useful=??????
Write docs: You've used it, haven't you?
Quit: Hmmm....
Then: Window title bar contents:
XXX: 10388 Disk name and free space in bytes. They could be
kilo/megabytes, but I want accuracy. Bytes is the Only
unit to show things like free (HD) space. Besides, I'm lazy
coding converting routines....
T:3779112 Total free memory in bytes.
L:2725408 Largest piece of memory.
F:2891096 Free Fast mem.
C: 887992 Free Chip mem.
22:07:42 clock
Depth gadget Hmmm....
;--------------
By the way, I don't like program packages with about >1000 files.
Program.exe, program.doc, program.data, program.P*SS, readme, readthose,
readthat... That's why I crunched & included these docs in the executable.
I... tttthink these docs will follow the program anywhere :^}.
¡BUG REPORT! ¡BUG REPORT! ¡BUG REPORT! ¡BUG REPORT! ¡BUG REPORT! ¡BUG REPORT!
(that line is piece of cake for LHA!)
After trying it, I couldn't make this program to create its own process and
free CLI. So, you (still in 1990's) have to start it by
'run <NIL: >NIL: MenuBlaster [configfile]'. Lame.
Due to only 16 bit MULU instruction of MC68000, I had to create piece of code
to get disk free space multiplied. You know, get Info on disk, you've to
calculate [ID_NUMBLOCKS-ID_NUMBLOCKSUSED]*ID_BYTESPERBLOCK=free_space.
If there's over 65535 blocks free, MULU.w is insufficient. But, due to
that piece of code, in this program maximum is 4194303 blocks free.
If there's 512 bytes per block, space is 2147483136 bytes, about 2GB.
After that display goes '-1'. Try it sometimes :^)...... (I can't.)
>¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^( >¦^(
Items with hotkey may be selected from menu also by pressing RAMIGA-hotkey
when MB window is active. Except that pressing e.g. RAMIGA-a pops up
About, not your program. That bug just caused me headache.
In gadget-structure there are gg_GadgetID(word) and gg_UserData(longword).
That's six bytes.... beautiful.
But, in menuitem-structure there's NOTHING! NOT A SINGLE BYTE USER TO USE AS
(S)HE WANTS! I used mi_Command(2 bytes) for that. I just left COMMSEQ flag
clear in mi_Flags, so, command key won't be shown.
Tuff luck. Doesn't crash the program, anyway..... maybe..... Nooooo, it works
just fine :^|
There's no way see hotkeys while MB is running. You just have to remember
them :^( . Of course I could set COMMSEQ when item had Command. But, but....
re-designing item creation routines.... headache.
Besides, then hotkeys 'aumdwq' wouldn't be available.
When you have set both FRONT and INACTIVATE flags, you can see another bug.
But, I'll let YOU to discover it.... there must be excitement in life.
If MB is started twice/more, there's two/more of them running.... lame, eh?
This program has been coded using 1.3 includes, because I CAN'T GET _WORKING_
2.0 INCLUDES ANYWHERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Using 2.0 specials, this program would be about..... 8kB. Still, it's small
compared to MM. This has 'docs' included and hotkeys. MB is about 1kB
bigger than MM executable.
Sh*t happens. Proof: Sh*t just happened.
Then some (more) disgusting bugs:
Intuition has been naughty! Intuition should be punished!
You must be familiar of selecting multiple menu items at once holding down
the menu button (=RMB) and selecting stuff by clicking select button (=LMB).
Works in all other programmer's programs, BUT NOT IN MENUBLASTER!!!!!!!!!!!!!!!!!!!!!!!!!!!
Intuition simply sends message about the first item and ignores the rest.
Someone, tell me how to fix that! I've checked everything: WD_FLAGS,
MU_FLAGS, MI_FLAGS. Beats me. Beats all my friends, too. Anyone, knowing
how to solve this, send me a postcard.
Another (OS) bug is a f*cking Guru. Includes explained it like this:
"AN_MemoryInsane equ $0100000C ; Sanity check on memory list failed
during AvailMem(MEMF_LARGEST)."
If you get that guru, don't blame MB/me. I just tried to fix that, but I was
p*ssed off about fixing OS bugs. I'm tired. I'm off. Try to survive.
-Version 1.1: Bug fixed (???). It'll still alert once, after that L: display
says -1. Might work.... maybe. It just checks $100 for #$0100000c........
-Version 1.2: Fixed a hotkey bug, that trashed about every 30th hotkey signal
from input.device kludge, so, pressing hotkey didn't effect at all.
¡END OF BUG REPORT! ¡END OF BUG REPORT! ¡END OF BUG REPORT! ¡END OF BUG REPORT!
Well, I'm about to crunch this cr*p. After all, I'm almost SICK of coding
this. It's time to move on, I've several new program ideas, at least function
generator and screensaver.
Gotta go now, programs to code, donuts to kill. Bye!
Signed 7.7.1993/1.1.1994 Archy